<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class FhIndex extends Model
{
	
    protected $table = 'fh_index';

    public static function boot()
    {
        parent::boot();

        static::saving(function ($model) {
            if($model->type==2){
                if(strpos($model->url, "/pages/") === false){
                    $model->url = "/pages/".$model->url;
                }
            }
           
        });
    }
    
}
